<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //splice的值如果在前面，就会出问题 错一位 如果在后面就不会出问题
        var active = 2






        var arr = [2,4,5,6]














        // console.log(arr[active])
        arr.splice(4,1)
        console.log(arr[active])
    </script>
</body>
</html>